package edu.sctu.practice.class02.yangshengyu.text01.test11;


import edu.sctu.practice.class02.yangshengyu.text01.test11.Vehicles;

import java.util.Scanner;

/**
 * Created by Cullen on 2015/10/20.
 */
public class Vehicles {
    public String carType;
    public int wholeNum;
    public String color;
    public double load;
    public int seats;

    public Vehicles(String carType, int wholeNum, String color, double load, int seats) {
        this.carType = carType;
        this.wholeNum = wholeNum;
        this.color = color;
        this.load = load;
        this.seats = seats;
    }

    public void speedUp() {
        System.out.println(this.carType + "类型的车百公里加速可达到4.5s");
    }

    public void speedDown() {
        System.out.println(this.carType + "该类型的车的制动效果突出");
    }

    public void stop() {
        System.out.println("具有停车监视功能");
    }

    public static void main(String[] args) {
        Vehicles vehicle = new Vehicles("SUV", 4, "black", 2.0, 4);

        System.out.println("此" + vehicle.carType + "类型的车" + "载客" + vehicle.seats + "人");
        System.out.println("车重" + vehicle.load + "吨  拥有" + vehicle.wholeNum + "个车轮");
        System.out.println("车的颜色是：" + vehicle.color);

        System.out.println("你想知道该类车型的特色嘛？(yes or no ?)");

        Scanner input = new Scanner(System.in);
        String a = input.nextLine();

        if (a.equals("yes")) {
            vehicle.speedUp();
            vehicle.speedDown();
            vehicle.stop();
        } else {
            System.out.println("谢谢");
        }
    }
}
